Skip to content

returns 400 on validator-faucets api when no validator_ids are sent#6131

Closed
JYC11 wants to merge 2 commits into
canton-network:mainfrom
JYC11:jaeyoon/fix-scan-validator-faucets-empty-output
Closed

returns 400 on validator-faucets api when no validator_ids are sent#6131
JYC11 wants to merge 2 commits into
canton-network:mainfrom
JYC11:jaeyoon/fix-scan-validator-faucets-empty-output

Conversation

@JYC11

@JYC11 JYC11 commented Jun 26, 2026

Copy link
Copy Markdown

fixes: #1964

The SQL syntax crash does not seem to occur as an empty array produces = ANY ('{}') which is valid SQL. A test asserting store returns Seq.empty for an empty input was added as a regression test in case inClause semantics change.

This PR instead addresses the user-facing concern: calling /v0/validators/validator-faucets with no validator_ids (or a misspelled key like validator=) used to return 200 + empty list, masking the typo. It now returns HTTP 400 with a clear error.

@JYC11 JYC11 changed the title fix scan validator faucets empty output returns 400 on validator-faucets api when no validator_ids are sent Jun 29, 2026
JYC11 added 2 commits June 30, 2026 01:34
Signed-off-by: JYC11 <jaeyoon.c@gmail.com>
Signed-off-by: JYC11 <jaeyoon.c@gmail.com>
@JYC11 JYC11 force-pushed the jaeyoon/fix-scan-validator-faucets-empty-output branch from 0d14bb2 to c2d6a03 Compare June 30, 2026 01:36
@isegall-da

Copy link
Copy Markdown
Contributor

fixes: #1964

The SQL syntax crash does not seem to occur as an empty array produces = ANY ('{}') which is valid SQL. A test asserting store returns Seq.empty for an empty input was added as a regression test in case inClause semantics change.

This PR instead addresses the user-facing concern: calling /v0/validators/validator-faucets with no validator_ids (or a misspelled key like validator=) used to return 200 + empty list, masking the typo. It now returns HTTP 400 with a clear error.

@JYC11 I'm confused by this statement:

The SQL syntax crash does not seem to occur

The issue says that it does occur. Did you try reproducing the issue?

@isegall-da

Copy link
Copy Markdown
Contributor

Seems like you're right, and the sql error has already been fixed.

$ curl https://scan.sv-1.dev.global.canton.network.sync.global/api/scan/v0/validators/validator-faucets?validator_ids=foo::bar
{"validatorsReceivedFaucets":[]}

Given that the issue is almost a year old, that's not too surprising.
Your PR covers only a very specific case of the validator IDs list truly being empty, not the case where they're all invalid (as above).
Having said that, given that liveness rewards have been removed from the network months ago, I don't think we want to invest in the UX of this endpoint TBH. I'd suggest we just close the issue and this PR.

@JYC11

JYC11 commented Jul 1, 2026

Copy link
Copy Markdown
Author

Seems like you're right, and the sql error has already been fixed.

$ curl https://scan.sv-1.dev.global.canton.network.sync.global/api/scan/v0/validators/validator-faucets?validator_ids=foo::bar
{"validatorsReceivedFaucets":[]}

Given that the issue is almost a year old, that's not too surprising. Your PR covers only a very specific case of the validator IDs list truly being empty, not the case where they're all invalid (as above). Having said that, given that liveness rewards have been removed from the network months ago, I don't think we want to invest in the UX of this endpoint TBH. I'd suggest we just close the issue and this PR.

That's fine by me, I'll close the PR. Can you close the issue?

@JYC11 JYC11 closed this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scan /v0/validators/validator-faucets should 400 or empty-result on no validators

5 participants